<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, MagicHash #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      : Data.Binary.Builder</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   : Lennart Kolmodin, Ross Paterson</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     : BSD3-style (see LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  : Lennart Kolmodin &lt;kolmodin@gmail.com&gt;</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   : experimental</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability : portable to Hugs and GHC</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Efficient constructions of lazy bytestrings.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- This now re-exports 'Data.ByteString.Lazy.Builder'.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Binary.Builder</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><span class="hs-comment">-- * The Builder type</span></span><span>
</span><span id="line-22"></span><span>      </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier">Builder</span></a></span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.html#toLazyByteString"><span class="hs-identifier">toLazyByteString</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Constructing Builders</span></span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#empty"><span class="hs-identifier">empty</span></a></span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#singleton"><span class="hs-identifier">singleton</span></a></span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#append"><span class="hs-identifier">append</span></a></span><span>
</span><span id="line-29"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#fromByteString"><span class="hs-identifier">fromByteString</span></a></span><span>        </span><span class="hs-comment">-- :: S.ByteString -&gt; Builder</span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#fromLazyByteString"><span class="hs-identifier">fromLazyByteString</span></a></span><span>    </span><span class="hs-comment">-- :: L.ByteString -&gt; Builder</span><span class="hs-cpp">
#if MIN_VERSION_bytestring(0,10,4)
</span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#fromShortByteString"><span class="hs-identifier">fromShortByteString</span></a></span><span>   </span><span class="hs-comment">-- :: T.ByteString -&gt; Builder</span><span class="hs-cpp">
#endif
</span><span>    </span><span class="annot"><span class="hs-comment">-- * Flushing the buffer state</span></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#flush"><span class="hs-identifier">flush</span></a></span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Derived Builders</span></span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Big-endian writes</span></span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord16be"><span class="hs-identifier">putWord16be</span></a></span><span>           </span><span class="hs-comment">-- :: Word16 -&gt; Builder</span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord32be"><span class="hs-identifier">putWord32be</span></a></span><span>           </span><span class="hs-comment">-- :: Word32 -&gt; Builder</span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord64be"><span class="hs-identifier">putWord64be</span></a></span><span>           </span><span class="hs-comment">-- :: Word64 -&gt; Builder</span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt16be"><span class="hs-identifier">putInt16be</span></a></span><span>            </span><span class="hs-comment">-- :: Int16 -&gt; Builder</span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt32be"><span class="hs-identifier">putInt32be</span></a></span><span>            </span><span class="hs-comment">-- :: Int32 -&gt; Builder</span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt64be"><span class="hs-identifier">putInt64be</span></a></span><span>            </span><span class="hs-comment">-- :: Int64 -&gt; Builder</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Little-endian writes</span></span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord16le"><span class="hs-identifier">putWord16le</span></a></span><span>           </span><span class="hs-comment">-- :: Word16 -&gt; Builder</span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord32le"><span class="hs-identifier">putWord32le</span></a></span><span>           </span><span class="hs-comment">-- :: Word32 -&gt; Builder</span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord64le"><span class="hs-identifier">putWord64le</span></a></span><span>           </span><span class="hs-comment">-- :: Word64 -&gt; Builder</span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt16le"><span class="hs-identifier">putInt16le</span></a></span><span>            </span><span class="hs-comment">-- :: Int16 -&gt; Builder</span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt32le"><span class="hs-identifier">putInt32le</span></a></span><span>            </span><span class="hs-comment">-- :: Int32 -&gt; Builder</span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt64le"><span class="hs-identifier">putInt64le</span></a></span><span>            </span><span class="hs-comment">-- :: Int64 -&gt; Builder</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Host-endian, unaligned writes</span></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWordhost"><span class="hs-identifier">putWordhost</span></a></span><span>           </span><span class="hs-comment">-- :: Word -&gt; Builder</span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord16host"><span class="hs-identifier">putWord16host</span></a></span><span>         </span><span class="hs-comment">-- :: Word16 -&gt; Builder</span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord32host"><span class="hs-identifier">putWord32host</span></a></span><span>         </span><span class="hs-comment">-- :: Word32 -&gt; Builder</span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord64host"><span class="hs-identifier">putWord64host</span></a></span><span>         </span><span class="hs-comment">-- :: Word64 -&gt; Builder</span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInthost"><span class="hs-identifier">putInthost</span></a></span><span>            </span><span class="hs-comment">-- :: Int -&gt; Builder</span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt16host"><span class="hs-identifier">putInt16host</span></a></span><span>          </span><span class="hs-comment">-- :: Int16 -&gt; Builder</span><span>
</span><span id="line-61"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt32host"><span class="hs-identifier">putInt32host</span></a></span><span>          </span><span class="hs-comment">-- :: Int32 -&gt; Builder</span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt64host"><span class="hs-identifier">putInt64host</span></a></span><span>          </span><span class="hs-comment">-- :: Int64 -&gt; Builder</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span>      </span><span class="annot"><span class="hs-comment">-- ** Unicode</span></span><span>
</span><span id="line-65"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putCharUtf8"><span class="hs-identifier">putCharUtf8</span></a></span><span>
</span><span id="line-66"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putStringUtf8"><span class="hs-identifier">putStringUtf8</span></a></span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span>      </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.html#"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span class="hs-cpp">

#if MIN_VERSION_bytestring(0,10,4)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.html#"><span class="hs-identifier">Data.ByteString.Short</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">T</span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.html#"><span class="hs-identifier">Data.ByteString.Builder</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#"><span class="hs-identifier">Data.ByteString.Builder.Prim</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Prim</span></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.html#"><span class="hs-identifier">Data.ByteString.Builder</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier">Builder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.html#toLazyByteString"><span class="hs-identifier">toLazyByteString</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Extra.html#"><span class="hs-identifier">Data.ByteString.Builder.Extra</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#flush"><span class="hs-identifier">flush</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Int.html#"><span class="hs-identifier">Data.Int</span></a></span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-comment">-- Silence AMP warning.</span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-comment">-- | /O(1)./ The empty Builder, satisfying</span><span>
</span><span id="line-88"></span><span class="hs-comment">--</span><span>
</span><span id="line-89"></span><span class="hs-comment">--  * @'toLazyByteString' 'empty' = 'L.empty'@</span><span>
</span><span id="line-90"></span><span class="hs-comment">--</span><span>
</span><span id="line-91"></span><span class="annot"><a href="Data.Binary.Builder.html#empty"><span class="hs-identifier hs-type">empty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-92"></span><span id="empty"><span class="annot"><span class="annottext">empty :: Builder
</span><a href="Data.Binary.Builder.html#empty"><span class="hs-identifier hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Builder
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-93"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#empty"><span class="hs-pragma hs-type">empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- | /O(1)./ A Builder taking a single byte, satisfying</span><span>
</span><span id="line-96"></span><span class="hs-comment">--</span><span>
</span><span id="line-97"></span><span class="hs-comment">--  * @'toLazyByteString' ('singleton' b) = 'L.singleton' b@</span><span>
</span><span id="line-98"></span><span class="hs-comment">--</span><span>
</span><span id="line-99"></span><span class="annot"><a href="Data.Binary.Builder.html#singleton"><span class="hs-identifier hs-type">singleton</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-100"></span><span id="singleton"><span class="annot"><span class="annottext">singleton :: Word8 -&gt; Builder
</span><a href="Data.Binary.Builder.html#singleton"><span class="hs-identifier hs-var hs-var">singleton</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#word8"><span class="hs-identifier hs-var">B.word8</span></a></span><span>
</span><span id="line-101"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="hs-comment">-- | /O(1)./ The concatenation of two Builders, an associative operation</span><span>
</span><span id="line-106"></span><span class="hs-comment">-- with identity 'empty', satisfying</span><span>
</span><span id="line-107"></span><span class="hs-comment">--</span><span>
</span><span id="line-108"></span><span class="hs-comment">--  * @'toLazyByteString' ('append' x y) = 'L.append' ('toLazyByteString' x) ('toLazyByteString' y)@</span><span>
</span><span id="line-109"></span><span class="hs-comment">--</span><span>
</span><span id="line-110"></span><span class="annot"><a href="Data.Binary.Builder.html#append"><span class="hs-identifier hs-type">append</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-111"></span><span id="append"><span class="annot"><span class="annottext">append :: Builder -&gt; Builder -&gt; Builder
</span><a href="Data.Binary.Builder.html#append"><span class="hs-identifier hs-var hs-var">append</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Builder -&gt; Builder -&gt; Builder
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span>
</span><span id="line-112"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#append"><span class="hs-pragma hs-type">append</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="hs-comment">-- | /O(1)./ A Builder taking a 'S.ByteString', satisfying</span><span>
</span><span id="line-115"></span><span class="hs-comment">--</span><span>
</span><span id="line-116"></span><span class="hs-comment">--  * @'toLazyByteString' ('fromByteString' bs) = 'L.fromChunks' [bs]@</span><span>
</span><span id="line-117"></span><span class="hs-comment">--</span><span>
</span><span id="line-118"></span><span class="annot"><a href="Data.Binary.Builder.html#fromByteString"><span class="hs-identifier hs-type">fromByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">S.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-119"></span><span id="fromByteString"><span class="annot"><span class="annottext">fromByteString :: ByteString -&gt; Builder
</span><a href="Data.Binary.Builder.html#fromByteString"><span class="hs-identifier hs-var hs-var">fromByteString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#byteString"><span class="hs-identifier hs-var">B.byteString</span></a></span><span>
</span><span id="line-120"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#fromByteString"><span class="hs-pragma hs-type">fromByteString</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="hs-comment">-- | /O(1)./ A Builder taking a lazy 'L.ByteString', satisfying</span><span>
</span><span id="line-123"></span><span class="hs-comment">--</span><span>
</span><span id="line-124"></span><span class="hs-comment">--  * @'toLazyByteString' ('fromLazyByteString' bs) = bs@</span><span>
</span><span id="line-125"></span><span class="hs-comment">--</span><span>
</span><span id="line-126"></span><span class="annot"><a href="Data.Binary.Builder.html#fromLazyByteString"><span class="hs-identifier hs-type">fromLazyByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">L.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-127"></span><span id="fromLazyByteString"><span class="annot"><span class="annottext">fromLazyByteString :: ByteString -&gt; Builder
</span><a href="Data.Binary.Builder.html#fromLazyByteString"><span class="hs-identifier hs-var hs-var">fromLazyByteString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#lazyByteString"><span class="hs-identifier hs-var">B.lazyByteString</span></a></span><span>
</span><span id="line-128"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#fromLazyByteString"><span class="hs-pragma hs-type">fromLazyByteString</span></a></span><span> </span><span class="hs-pragma">#-}</span><span class="hs-cpp">

#if MIN_VERSION_bytestring(0,10,4)
</span><span class="hs-comment">-- | /O(n)./ A builder taking 'T.ShortByteString' and copy it to a Builder,</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- satisfying</span><span>
</span><span id="line-133"></span><span class="hs-comment">--</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- * @'toLazyByteString' ('fromShortByteString' bs) = 'L.fromChunks' ['T.fromShort' bs]</span><span>
</span><span id="line-135"></span><span class="annot"><a href="Data.Binary.Builder.html#fromShortByteString"><span class="hs-identifier hs-type">fromShortByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">T.ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-136"></span><span id="fromShortByteString"><span class="annot"><span class="annottext">fromShortByteString :: ShortByteString -&gt; Builder
</span><a href="Data.Binary.Builder.html#fromShortByteString"><span class="hs-identifier hs-var hs-var">fromShortByteString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#shortByteString"><span class="hs-identifier hs-var">B.shortByteString</span></a></span><span>
</span><span id="line-137"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#fromShortByteString"><span class="hs-pragma hs-type">fromShortByteString</span></a></span><span> </span><span class="hs-pragma">#-}</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-140"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="hs-comment">-- | Write a Word16 in big endian format</span><span>
</span><span id="line-143"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord16be"><span class="hs-identifier hs-type">putWord16be</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-144"></span><span id="putWord16be"><span class="annot"><span class="annottext">putWord16be :: Word16 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord16be"><span class="hs-identifier hs-var hs-var">putWord16be</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#word16BE"><span class="hs-identifier hs-var">B.word16BE</span></a></span><span>
</span><span id="line-145"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord16be"><span class="hs-pragma hs-type">putWord16be</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="hs-comment">-- | Write a Word16 in little endian format</span><span>
</span><span id="line-148"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord16le"><span class="hs-identifier hs-type">putWord16le</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-149"></span><span id="putWord16le"><span class="annot"><span class="annottext">putWord16le :: Word16 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord16le"><span class="hs-identifier hs-var hs-var">putWord16le</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#word16LE"><span class="hs-identifier hs-var">B.word16LE</span></a></span><span>
</span><span id="line-150"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord16le"><span class="hs-pragma hs-type">putWord16le</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="hs-comment">-- | Write a Word32 in big endian format</span><span>
</span><span id="line-153"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord32be"><span class="hs-identifier hs-type">putWord32be</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-154"></span><span id="putWord32be"><span class="annot"><span class="annottext">putWord32be :: Word32 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord32be"><span class="hs-identifier hs-var hs-var">putWord32be</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#word32BE"><span class="hs-identifier hs-var">B.word32BE</span></a></span><span>
</span><span id="line-155"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord32be"><span class="hs-pragma hs-type">putWord32be</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span class="hs-comment">-- | Write a Word32 in little endian format</span><span>
</span><span id="line-158"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord32le"><span class="hs-identifier hs-type">putWord32le</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-159"></span><span id="putWord32le"><span class="annot"><span class="annottext">putWord32le :: Word32 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord32le"><span class="hs-identifier hs-var hs-var">putWord32le</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#word32LE"><span class="hs-identifier hs-var">B.word32LE</span></a></span><span>
</span><span id="line-160"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord32le"><span class="hs-pragma hs-type">putWord32le</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-comment">-- | Write a Word64 in big endian format</span><span>
</span><span id="line-163"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord64be"><span class="hs-identifier hs-type">putWord64be</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-164"></span><span id="putWord64be"><span class="annot"><span class="annottext">putWord64be :: Word64 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord64be"><span class="hs-identifier hs-var hs-var">putWord64be</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#word64BE"><span class="hs-identifier hs-var">B.word64BE</span></a></span><span>
</span><span id="line-165"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord64be"><span class="hs-pragma hs-type">putWord64be</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span class="hs-comment">-- | Write a Word64 in little endian format</span><span>
</span><span id="line-168"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord64le"><span class="hs-identifier hs-type">putWord64le</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-169"></span><span id="putWord64le"><span class="annot"><span class="annottext">putWord64le :: Word64 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord64le"><span class="hs-identifier hs-var hs-var">putWord64le</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#word64LE"><span class="hs-identifier hs-var">B.word64LE</span></a></span><span>
</span><span id="line-170"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord64le"><span class="hs-pragma hs-type">putWord64le</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="hs-comment">-- | Write a Int16 in big endian format</span><span>
</span><span id="line-173"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt16be"><span class="hs-identifier hs-type">putInt16be</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-174"></span><span id="putInt16be"><span class="annot"><span class="annottext">putInt16be :: Int16 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt16be"><span class="hs-identifier hs-var hs-var">putInt16be</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int16 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#int16BE"><span class="hs-identifier hs-var">B.int16BE</span></a></span><span>
</span><span id="line-175"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt16be"><span class="hs-pragma hs-type">putInt16be</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">-- | Write a Int16 in little endian format</span><span>
</span><span id="line-178"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt16le"><span class="hs-identifier hs-type">putInt16le</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-179"></span><span id="putInt16le"><span class="annot"><span class="annottext">putInt16le :: Int16 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt16le"><span class="hs-identifier hs-var hs-var">putInt16le</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int16 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#int16LE"><span class="hs-identifier hs-var">B.int16LE</span></a></span><span>
</span><span id="line-180"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt16le"><span class="hs-pragma hs-type">putInt16le</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="hs-comment">-- | Write a Int32 in big endian format</span><span>
</span><span id="line-183"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt32be"><span class="hs-identifier hs-type">putInt32be</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-184"></span><span id="putInt32be"><span class="annot"><span class="annottext">putInt32be :: Int32 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt32be"><span class="hs-identifier hs-var hs-var">putInt32be</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int32 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#int32BE"><span class="hs-identifier hs-var">B.int32BE</span></a></span><span>
</span><span id="line-185"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt32be"><span class="hs-pragma hs-type">putInt32be</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="hs-comment">-- | Write a Int32 in little endian format</span><span>
</span><span id="line-188"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt32le"><span class="hs-identifier hs-type">putInt32le</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-189"></span><span id="putInt32le"><span class="annot"><span class="annottext">putInt32le :: Int32 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt32le"><span class="hs-identifier hs-var hs-var">putInt32le</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int32 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#int32LE"><span class="hs-identifier hs-var">B.int32LE</span></a></span><span>
</span><span id="line-190"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt32le"><span class="hs-pragma hs-type">putInt32le</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span class="hs-comment">-- | Write a Int64 in big endian format</span><span>
</span><span id="line-193"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt64be"><span class="hs-identifier hs-type">putInt64be</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-194"></span><span id="putInt64be"><span class="annot"><span class="annottext">putInt64be :: Int64 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt64be"><span class="hs-identifier hs-var hs-var">putInt64be</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#int64BE"><span class="hs-identifier hs-var">B.int64BE</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="hs-comment">-- | Write a Int64 in little endian format</span><span>
</span><span id="line-197"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt64le"><span class="hs-identifier hs-type">putInt64le</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-198"></span><span id="putInt64le"><span class="annot"><span class="annottext">putInt64le :: Int64 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt64le"><span class="hs-identifier hs-var hs-var">putInt64le</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.html#int64LE"><span class="hs-identifier hs-var">B.int64LE</span></a></span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-202"></span><span class="hs-comment">-- Unaligned, word size ops</span><span>
</span><span id="line-203"></span><span>
</span><span id="line-204"></span><span class="hs-comment">-- | /O(1)./ A Builder taking a single native machine word. The word is</span><span>
</span><span id="line-205"></span><span class="hs-comment">-- written in host order, host endian form, for the machine you're on.</span><span>
</span><span id="line-206"></span><span class="hs-comment">-- On a 64 bit machine the Word is an 8 byte value, on a 32 bit machine,</span><span>
</span><span id="line-207"></span><span class="hs-comment">-- 4 bytes. Values written this way are not portable to</span><span>
</span><span id="line-208"></span><span class="hs-comment">-- different endian or word sized machines, without conversion.</span><span>
</span><span id="line-209"></span><span class="hs-comment">--</span><span>
</span><span id="line-210"></span><span class="annot"><a href="Data.Binary.Builder.html#putWordhost"><span class="hs-identifier hs-type">putWordhost</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-211"></span><span id="putWordhost"><span class="annot"><span class="annottext">putWordhost :: Word -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWordhost"><span class="hs-identifier hs-var hs-var">putWordhost</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word -&gt; Word -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#wordHost"><span class="hs-identifier hs-var">Prim.wordHost</span></a></span><span>
</span><span id="line-212"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWordhost"><span class="hs-pragma hs-type">putWordhost</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="hs-comment">-- | Write a Word16 in native host order and host endianness.</span><span>
</span><span id="line-215"></span><span class="hs-comment">-- 2 bytes will be written, unaligned.</span><span>
</span><span id="line-216"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord16host"><span class="hs-identifier hs-type">putWord16host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-217"></span><span id="putWord16host"><span class="annot"><span class="annottext">putWord16host :: Word16 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord16host"><span class="hs-identifier hs-var hs-var">putWord16host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word16 -&gt; Word16 -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word16
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#word16Host"><span class="hs-identifier hs-var">Prim.word16Host</span></a></span><span>
</span><span id="line-218"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord16host"><span class="hs-pragma hs-type">putWord16host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span class="hs-comment">-- | Write a Word32 in native host order and host endianness.</span><span>
</span><span id="line-221"></span><span class="hs-comment">-- 4 bytes will be written, unaligned.</span><span>
</span><span id="line-222"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord32host"><span class="hs-identifier hs-type">putWord32host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-223"></span><span id="putWord32host"><span class="annot"><span class="annottext">putWord32host :: Word32 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord32host"><span class="hs-identifier hs-var hs-var">putWord32host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32 -&gt; Word32 -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word32
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#word32Host"><span class="hs-identifier hs-var">Prim.word32Host</span></a></span><span>
</span><span id="line-224"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord32host"><span class="hs-pragma hs-type">putWord32host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span class="hs-comment">-- | Write a Word64 in native host order.</span><span>
</span><span id="line-227"></span><span class="hs-comment">-- On a 32 bit machine we write two host order Word32s, in big endian form.</span><span>
</span><span id="line-228"></span><span class="hs-comment">-- 8 bytes will be written, unaligned.</span><span>
</span><span id="line-229"></span><span class="annot"><a href="Data.Binary.Builder.html#putWord64host"><span class="hs-identifier hs-type">putWord64host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-230"></span><span id="putWord64host"><span class="annot"><span class="annottext">putWord64host :: Word64 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putWord64host"><span class="hs-identifier hs-var hs-var">putWord64host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64 -&gt; Word64 -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Word64
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#word64Host"><span class="hs-identifier hs-var">Prim.word64Host</span></a></span><span>
</span><span id="line-231"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putWord64host"><span class="hs-pragma hs-type">putWord64host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span class="hs-comment">-- | /O(1)./ A Builder taking a single native machine word. The word is</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- written in host order, host endian form, for the machine you're on.</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- On a 64 bit machine the Int is an 8 byte value, on a 32 bit machine,</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- 4 bytes. Values written this way are not portable to</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- different endian or word sized machines, without conversion.</span><span>
</span><span id="line-238"></span><span class="hs-comment">--</span><span>
</span><span id="line-239"></span><span class="annot"><a href="Data.Binary.Builder.html#putInthost"><span class="hs-identifier hs-type">putInthost</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-240"></span><span id="putInthost"><span class="annot"><span class="annottext">putInthost :: Int -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInthost"><span class="hs-identifier hs-var hs-var">putInthost</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int -&gt; Int -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Int
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#intHost"><span class="hs-identifier hs-var">Prim.intHost</span></a></span><span>
</span><span id="line-241"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInthost"><span class="hs-pragma hs-type">putInthost</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="hs-comment">-- | Write a Int16 in native host order and host endianness.</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- 2 bytes will be written, unaligned.</span><span>
</span><span id="line-245"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt16host"><span class="hs-identifier hs-type">putInt16host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-246"></span><span id="putInt16host"><span class="annot"><span class="annottext">putInt16host :: Int16 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt16host"><span class="hs-identifier hs-var hs-var">putInt16host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int16 -&gt; Int16 -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Int16
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#int16Host"><span class="hs-identifier hs-var">Prim.int16Host</span></a></span><span>
</span><span id="line-247"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt16host"><span class="hs-pragma hs-type">putInt16host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- | Write a Int32 in native host order and host endianness.</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- 4 bytes will be written, unaligned.</span><span>
</span><span id="line-251"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt32host"><span class="hs-identifier hs-type">putInt32host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-252"></span><span id="putInt32host"><span class="annot"><span class="annottext">putInt32host :: Int32 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt32host"><span class="hs-identifier hs-var hs-var">putInt32host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int32 -&gt; Int32 -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Int32
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#int32Host"><span class="hs-identifier hs-var">Prim.int32Host</span></a></span><span>
</span><span id="line-253"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt32host"><span class="hs-pragma hs-type">putInt32host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-comment">-- | Write a Int64 in native host order.</span><span>
</span><span id="line-256"></span><span class="hs-comment">-- On a 32 bit machine we write two host order Int32s, in big endian form.</span><span>
</span><span id="line-257"></span><span class="hs-comment">-- 8 bytes will be written, unaligned.</span><span>
</span><span id="line-258"></span><span class="annot"><a href="Data.Binary.Builder.html#putInt64host"><span class="hs-identifier hs-type">putInt64host</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-259"></span><span id="putInt64host"><span class="annot"><span class="annottext">putInt64host :: Int64 -&gt; Builder
</span><a href="Data.Binary.Builder.html#putInt64host"><span class="hs-identifier hs-var hs-var">putInt64host</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixedPrim Int64 -&gt; Int64 -&gt; Builder
forall a. FixedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primFixed"><span class="hs-identifier hs-var">Prim.primFixed</span></a></span><span> </span><span class="annot"><span class="annottext">FixedPrim Int64
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Binary.html#int64Host"><span class="hs-identifier hs-var">Prim.int64Host</span></a></span><span>
</span><span id="line-260"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putInt64host"><span class="hs-pragma hs-type">putInt64host</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-264"></span><span class="hs-comment">-- Unicode</span><span>
</span><span id="line-265"></span><span>
</span><span id="line-266"></span><span class="hs-comment">-- | Write a character using UTF-8 encoding.</span><span>
</span><span id="line-267"></span><span class="annot"><a href="Data.Binary.Builder.html#putCharUtf8"><span class="hs-identifier hs-type">putCharUtf8</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-268"></span><span id="putCharUtf8"><span class="annot"><span class="annottext">putCharUtf8 :: Char -&gt; Builder
</span><a href="Data.Binary.Builder.html#putCharUtf8"><span class="hs-identifier hs-var hs-var">putCharUtf8</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BoundedPrim Char -&gt; Char -&gt; Builder
forall a. BoundedPrim a -&gt; a -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primBounded"><span class="hs-identifier hs-var">Prim.primBounded</span></a></span><span> </span><span class="annot"><span class="annottext">BoundedPrim Char
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#charUtf8"><span class="hs-identifier hs-var">Prim.charUtf8</span></a></span><span>
</span><span id="line-269"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putCharUtf8"><span class="hs-pragma hs-type">putCharUtf8</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span class="hs-comment">-- | Write a String using UTF-8 encoding.</span><span>
</span><span id="line-272"></span><span class="annot"><a href="Data.Binary.Builder.html#putStringUtf8"><span class="hs-identifier hs-type">putStringUtf8</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">Builder</span></a></span><span>
</span><span id="line-273"></span><span id="putStringUtf8"><span class="annot"><span class="annottext">putStringUtf8 :: String -&gt; Builder
</span><a href="Data.Binary.Builder.html#putStringUtf8"><span class="hs-identifier hs-var hs-var">putStringUtf8</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BoundedPrim Char -&gt; String -&gt; Builder
forall a. BoundedPrim a -&gt; [a] -&gt; Builder
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#primMapListBounded"><span class="hs-identifier hs-var">Prim.primMapListBounded</span></a></span><span> </span><span class="annot"><span class="annottext">BoundedPrim Char
</span><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#charUtf8"><span class="hs-identifier hs-var">Prim.charUtf8</span></a></span><span>
</span><span id="line-274"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Builder.html#putStringUtf8"><span class="hs-pragma hs-type">putStringUtf8</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-275"></span></pre></body></html>